define(["jquery"],function($){
	var tpl = {};

	tpl.init = function(){
		var h = "";
		h += total();
		h += dtext_column();
		h += dtext_column_group();
		h += dtext_column_leaf();
		return h;
	}

	var total = function(){
		return  '<script id="tpl_dtext_total" type="text/html">'+
				'	{{if template=="dtext_column"}}'+
				'		{{include "tpl_dtext_column",data}}'+
				'	{{/if}}'+
				'</script>';
	}

	var dtext_column = function(){
		return  '<script id="tpl_dtext_column" type="text/html">'+
				'	<div class="dtext-custom">'+
				'		{{each questions as value i}}'+
				'			{{if value.type=="group" }}'+
				'				{{include "tpl_dtext_column_group",value}}'+
				'			{{else if value.type=="leaf"}}'+
				'				{{include "tpl_dtext_column_leaf",value}}'+
				'			{{/if}}'+
				'		{{/each}}'+
				//'		<div class="add-item dtext-add-item">添加栏目</div>'+
				'	</div>'+
				'</script>';
	}
	var dtext_column_group = function(){
		return  '<script id="tpl_dtext_column_group" type="text/html">'+
				'	{{if show}}'+
				'		<div class="item">'+
				'			<div class="tit clearfix">'+
				'				<span>基本资料</span>'+
				//'				<i class="fa fa-plus"></i>'+
				'			</div>'+
				'			{{each children as value i}}'+
				'				{{if value.type=="group" }}'+
				'					{{include "tpl_dtext_column_group",value}}'+
				'				{{else if value.type=="leaf"}}'+
				'					{{include "tpl_dtext_column_leaf",value}}'+
				'				{{/if}}'+
				'			{{/each}}'+
				'		</div>'+
				'	{{/if}}'+
				'</script>';
	}
	var dtext_column_leaf = function(){
		return  '<script id="tpl_dtext_column_leaf" type="text/html">'+
				'	{{if show}}'+
				'		<div class="con">{{name}}：{{val}}</div>'+
				'	{{/if}}'+
				'</script>';
	}

	return tpl;
});